package cn.wolfcode.ssm.enums;

import lombok.Getter;

@Getter
public enum BusinessReportGroupTpyeEnum {
    BUSINESS("门店","b.name"),
    YEAR("年","DATE_FORMAT(c.create_time,'%Y')"),
    MONTH("月","DATE_FORMAT(c.create_time,'%Y-%m')"),
    DAY("日","DATE_FORMAT(c.create_time,'%Y-%m-%d')");

    private String name;
    private String value;

    BusinessReportGroupTpyeEnum(String name, String value) {
        this.name = name;
        this.value = value;
    }

    public static String findEnumNameByValue(String value){
        BusinessReportGroupTpyeEnum[] values = BusinessReportGroupTpyeEnum.values();
        for (BusinessReportGroupTpyeEnum anEnum : values) {
            if (anEnum.value.equals(value)) {
                return anEnum.name;
            }
        }
        return null;
    }
}
